# include "ShaderResourceViewBindAble.h"
# include "d3d11.h"

ShaderResourceViewBindAble::ShaderResourceViewBindAble(ID3D11Device* _device, ID3D11Texture2D* _texture)
{
	D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = CD3D11_SHADER_RESOURCE_VIEW_DESC(
		_texture,
		D3D11_SRV_DIMENSION_TEXTURE2D,
		DXGI_FORMAT_B8G8R8A8_UNORM
	);
	_device->CreateShaderResourceView(_texture, &srvDesc, this->m_resourceView.GetAddressOf());
}

void ShaderResourceViewBindAble::bind(ID3D11DeviceContext* _context)
{
	_context->PSSetShaderResources(0, 1, this->m_resourceView.GetAddressOf());
}

ShaderResourceViewBindAble::~ShaderResourceViewBindAble()
{

}
